package com.ruoyi.shop.mq.kafka;

import com.ruoyi.shop.protocol.websocket.server.DataServer;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Service;

//@Service
//public class KafkaConsumerService {
//
//    @KafkaListener(topics = "order_window", groupId = "my-group1")
//    public void consumer1(String message) {
//        System.out.println("Received OrderWindow message: " + message);
//        String[] split = message.split(":");
//        String orderCount = split[1];
//        // 推送消息
//        DataServer.sendMessage(orderCount);
//        //        将消息转发给sse
////        SseServer.sendBroadcast(message);
//    }
//
//    @KafkaListener(topics = "order_total", groupId = "my-group2")
//    public void consumer2(String message) {
//        System.out.println("Received OrderTotal message: " + message);
//    }
//}
